<?php

namespace common\validate;

class TagRelation extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // Bind 验证场景定义
    public function sceneBind()
    {
        return $this->append('data', 'require|array');
    }

    // UpdateBind 验证场景定义
    public function sceneUpdateBind()
    {
        return $this->append('data', 'require|array')
            ->append('data.tag_id', 'require|integer')
            ->append('data.relation_id', 'require|integer')
            ->append('data.relation_type', 'require|integer')
            ->append('data.step_category_id', 'integer')
            ->append('data.entity_ids', 'array');
    }

    // Unbind 验证场景定义
    public function sceneUnbind()
    {
        return $this->append('data', 'require|array')
            ->append('data.relation_id', 'require|integer')
            ->append('data.relation_type', 'require|integer');
    }

    // GetTagsByRelationIds 验证场景定义
    public function sceneGetTagsByRelationIds()
    {
        return $this->append('param', 'require|array');
    }
}
